<?php 
define('IN_QY',true);
session_start();
require("include/common.inc.php");
require_once("include/config.php");
require_once("include/httpUtil.php");
if(!$_COOKIE['userid']){
	$arr = array('error'=>1,'msg'=>'添加成功！');
	echo json_encode($arr);
}

$money = $_POST['goodid'];
//数量变更

$sql="select * from tbl_user where id=".$_COOKIE['userid'];
$a=mysql_query($sql);
$rowa=mysql_fetch_array($a);

	$yuanexpore=$rowa['vipexpire'];
	$time2=date('Y-m-d H:i:s',strtotime("+$time month",strtotime($yuanexpore)));
	// $sql="update tbl_user set viplevel=".$dji.",vipexpire='".$time2."' where id=".$_COOKIE['userid'];
     // mysql_query($sql);
//入账				 
	$sqlyyq = "insert into tbl_vippay values (0,'".$_COOKIE['userid']."','".$money."','".$money."','".date('Y-m-d H:i:s')."',1)";
	 mysql_query($sqlyyq);	
	 
	         $conten = "成为vip费用";
	 
	         $sqltyue = "insert into tbl_zhangdan values (0,'".$conten."','".$realava."','".$resultji['jifen']."',0,1,0,'".date("Y-m-d H:i:s")."','".$$_COOKIE['userid']."','".$infoid."',0,2)";
	   mysql_query($sqltyue);
	//短信发送开始--支付成功了
$funAndOperate = "industrySMS/sendSMS";
// 生成body
$body = createBasicAuthData();
// 在基本认证参数的基础上添加短信内容和发送目标号码的参数
$body['smsContent'] = '【众晒网】亲爱的'.$_COOKIE['shuyu'].'，您已成功消费'.$money.'元，感谢您的支持';
$body['to'] = ''.$_COOKIE['username'].'';
$result = post($funAndOperate, $body);
 //短信发送结束 
	 
	 
	 
	$arr = array('error'=>0,'msg'=>'添加成功！');
	echo json_encode($arr);
